package com.cxl.price.util;

import java.util.Properties;


/**
 * @author Roly
 * TODO 
 */
public class SummerGlobals {
    
    private static SummerGlobals _const;
    private static Properties props;
    public static String configFileName = "price.properties";
    
    static {
        if(_const == null)
            _const = new SummerGlobals();
    }
    
    public SummerGlobals() {
        loadProperties();
    }
    
    public static String getProperty(String key) {
        return props.getProperty(key);
    }
    
    public static void setProperty(String key,String value) {
        props.setProperty(key,value);
    }
    
    public static void loadProperties() {
        props = PropertiesUtils.load(configFileName);
    }
    
    public static void saveProperties() {
        PropertiesUtils.save(props,configFileName);
    }
    
    public static void main(String[] args) {

        SummerGlobals.setProperty("com.ascrm.debug","true");
        SummerGlobals.setProperty("com.ascrm.log.path","/log");
        SummerGlobals.setProperty("com.ascrm.administrator.user","admin");
        SummerGlobals.setProperty("com.ascrm.administrator.pwd","");
        SummerGlobals.setProperty("com.ascrm.upload.allowFileList","gif,jpg,bmp,png,jpeg,bak,xls,sql,txt,rar,zip,doc,pdf,ppt,vsd,jar,rtf");
        SummerGlobals.setProperty("com.ascrm.upload.maxSize","300");
        SummerGlobals.saveProperties();

    }
}
